//
//  TabBarItem.m
//  MyProject
//
//  Created by Pei on 16/6/19.
//  Copyright © 2016年 Xiaobo Pei. All rights reserved.
//
#import "TabBarItem.h"

@implementation TabBarItem

- (id)initWithFrame:(CGRect)frame
{
    self = [super initWithFrame:frame];
    if (self)
    {
        //self.titleLabel.font = kAppFont(26.0f/2.0f);
        self.titleLabel.textAlignment = NSTextAlignmentCenter;
    }
    return self;
}

#define kWidth self.frame.size.width
#define kHeight self.frame.size.height
#define kImageHeight 45/2.0f//kHeight/8*5
#define kXOffSet (kWidth-kImageHeight)/2


- (CGRect)imageRectForContentRect:(CGRect)contentRect {
    
    return CGRectMake(kXOffSet, 10, kImageHeight, kImageHeight);
    
}

- (CGRect)titleRectForContentRect:(CGRect)contentRect {
    
    return CGRectMake(0, kImageHeight+6, kWidth, kHeight-kImageHeight-3);
}

- (void) setNormalImage:(UIImage *)image
{
    //self.titleLabel.textColor = [CDUtil colorWithHexString:@"#969696"];
    [super setImage:image forState:UIControlStateNormal];
}

- (void) setSelectedImage:(UIImage *)image
{
    //self.titleLabel.textColor = [CDUtil colorWithHexString:@"#FF5045"];
    [super setImage:image forState:UIControlStateSelected];
}

@end
